// 变量定义
$primary-color: #3b82f6;
$secondary-color: #10b981;
$danger-color: #ef4444;
$warning-color: #f59e0b;
$text-primary: #1e293b;
$text-secondary: #64748b;
$border-color: #e2e8f0;
$background-light: #f8fafc;
$card-background: #ffffff;
$hover-color: #f1f5f9;
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

.manager {
  padding: 15px;

  // 折叠面板样式
  .el-collapse {
    border: none;
    background: transparent;

    .el-collapse-item {
      margin-bottom: 1rem;
      border-radius: 0.75rem;
      background: $card-background;
      box-shadow: $shadow-sm;
      transition: all 0.3s ease;
      overflow: hidden;

      &:hover {
        box-shadow: $shadow-md;
      }

      &__header {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        font-weight: 600;
        color: $text-primary;
        background: $card-background;
        border: none;
        position: relative;
        transition: all 0.2s ease;

        &:hover {
          color: $primary-color;
          background: $hover-color;
        }

        .el-collapse-item__arrow {
          font-weight: bold;
          color: $text-secondary;
          transition: transform 0.3s ease;
        }
      }

      &__content {
        padding: 1.25rem;
        background: linear-gradient(to bottom, $background-light, $card-background);
      }

      &.is-active {
        .el-collapse-item__header {
          border-bottom: 1px solid $border-color;
          margin-bottom: 0;
        }
      }
    }
  }

  // 表单样式优化
  .el-form {
    &-item {
      margin-bottom: 1.25rem;

      &__label {
        font-weight: 500;
        color: $text-primary;
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
      }
    }
  }

  // 输入框样式
  .el-input, .el-textarea {
    &__inner {
      border-radius: 0.5rem;
      border: 1px solid $border-color;
      padding: 0.625rem 0.875rem;
      font-size: 0.875rem;
      transition: all 0.2s ease;
      
      &:hover {
        border-color: darken($border-color, 10%);
      }
      
      &:focus {
        border-color: $primary-color;
        box-shadow: 0 0 0 2px rgba($primary-color, 0.1);
      }
    }
  }

  // 相关技能模块样式
  .skill-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    
    th {
      background: $background-light;
      padding: 0.75rem 1rem;
      text-align: left;
      font-weight: 600;
      color: $text-primary;
      font-size: 0.875rem;
      border-bottom: 2px solid $border-color;
      &:first-child { border-radius: 0.5rem 0 0 0; }
      &:last-child { border-radius: 0 0.5rem 0 0; }
    }
    
    td {
      padding: 0.75rem 1rem;
      border-bottom: 1px solid $border-color;
      color: $text-secondary;
      font-size: 0.875rem;
      
      &:last-child {
        text-align: right;
      }
    }
    
    tr {
      transition: all 0.2s ease;
      
      &:hover {
        background-color: $hover-color;
      }
      
      &:last-child td {
        border-bottom: none;
        &:first-child { border-radius: 0 0 0 0.5rem; }
        &:last-child { border-radius: 0 0 0.5rem 0; }
      }
    }
  }

  // 编辑/删除按钮样式
  .action-button {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid $border-color;
    background: $card-background;
    color: $text-secondary;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    
    &:hover {
      color: $primary-color;
      border-color: $primary-color;
      background: $hover-color;
      transform: translateY(-1px);
    }
    
    &.delete {
      &:hover {
        color: $danger-color;
        border-color: $danger-color;
        background: rgba($danger-color, 0.1);
      }
    }
  }

  // 底部按钮样式
  .bottom-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

    button {
      padding: 10px 24px;
      border: none;
      border-radius: 6px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;

      &.print {
        background: $primary-color;
        color: white;

        &:hover {
          background: darken($primary-color, 10%);
        }
      }

      &.switch {
        background: #67c23a;
        color: white;

        &:hover {
          background: darken(#67c23a, 10%);
        }
      }
    }
  }

  // 优先级控制样式
  .priority-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: $background-light;
    border-radius: 0.5rem;

    .priority-number {
      font-weight: 600;
      color: $text-primary;
      font-size: 0.875rem;
    }

    .priority-buttons {
      display: flex;
      gap: 0.375rem;

      button {
        padding: 0.375rem 0.75rem;
        border: 1px solid $border-color;
        background: $card-background;
        border-radius: 0.375rem;
        cursor: pointer;
        color: $text-secondary;
        transition: all 0.2s ease;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        gap: 0.25rem;

        &:hover {
          color: $primary-color;
          border-color: $primary-color;
          background: $hover-color;
          transform: translateY(-1px);
        }
      }
    }
  }
}

// 编辑对话框样式
.edit-dialog {
  max-height: 90vh;
  overflow-y: auto;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  z-index: 9999;
  width: 90%;
  max-width: 520px;

  // 滚动条样式
  &::-webkit-scrollbar {
    width: 6px;
  }

  &::-webkit-scrollbar-track {
    background: transparent;
  }

  &::-webkit-scrollbar-thumb {
    background: #dcdfe6;
    border-radius: 3px;
    
    &:hover {
      background: #c0c4cc;
    }
  }

  h3 {
    margin: 0 0 24px 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    padding-bottom: 16px;
    border-bottom: 1px solid #ebeef5;
  }

  .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;

    .form-group {
      flex: 1;
      margin-bottom: 0;
    }
  }

  .form-group {
    margin-bottom: 18px;

    &.full-width {
      width: 100%;
    }

    label {
      display: block;
      font-size: 14px;
      color: #606266;
      margin-bottom: 8px;
      line-height: 1.4;

      &.required::before {
        content: '*';
        color: #f56c6c;
        margin-right: 4px;
      }
    }

    input, textarea, select {
      width: 100%;
      padding: 0 12px;
      border: 1px solid #dcdfe6;
      border-radius: 4px;
      font-size: 14px;
      color: #606266;
      transition: border-color 0.2s;
      background-color: #fff;
      height: 32px;
      line-height: 32px;

      &::placeholder {
        color: #c0c4cc;
      }

      &:hover {
        border-color: #c0c4cc;
      }

      &:focus {
        outline: none;
        border-color: #409eff;
      }
    }

    // 日期输入框特殊样式
    input[type="date"] {
      padding-right: 8px;
      font-family: inherit;

      &::-webkit-calendar-picker-indicator {
        cursor: pointer;
        opacity: 0.7;
        padding: 4px;
        margin-right: -4px;

        &:hover {
          opacity: 1;
        }
      }
    }

    textarea {
      min-height: 120px;
      height: auto;
      resize: vertical;
      padding: 8px 12px;
      line-height: 1.5;
    }

    select {
      appearance: none;
      padding-right: 30px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23C0C4CC'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 8px center;
      background-size: 16px;
      cursor: pointer;

      &:invalid {
        color: #c0c4cc;
      }
    }
  }

  .button-group {
    text-align: right;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #ebeef5;

    button {
      padding: 8px 20px;
      border: 1px solid #dcdfe6;
      border-radius: 4px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;
      background-color: #fff;
      margin-left: 12px;
      min-width: 68px;
      line-height: 1;
      height: 32px;

      &.save-btn {
        background-color: #409eff;
        border-color: #409eff;
        color: white;

        &:hover {
          background-color: #66b1ff;
          border-color: #66b1ff;
        }

        &:active {
          background-color: #3a8ee6;
          border-color: #3a8ee6;
        }
      }

      &.cancel-btn {
        color: #606266;

        &:hover {
          color: #409eff;
          border-color: #c6e2ff;
          background-color: #ecf5ff;
        }

        &:active {
          color: #3a8ee6;
          border-color: #b3d8ff;
          background-color: #e6f1fc;
        }
      }
    }
  }
}

// 遮罩层样式
.dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9998;
}

// 原始样式
p {
  font-family: monospace;
  font-size: 13px;
}

summary {
  font-size: 1rem;
  font-weight: 600;
  background-color: #f3f3f3;
  color: #000;
  padding: 1rem;
  margin-bottom: 1rem;
  outline: none;
  border-radius: 0.25rem;
  cursor: pointer;
  position: relative;
}

details[open] summary~* {
  animation: sweep .1s ease-in-out;
}

@keyframes sweep {
  0% {
    opacity: 0;
    margin-top: -10px
  }

  100% {
    opacity: 1;
    margin-top: 0px
  }
}

details>summary::after {
  position: absolute;
  content: "+";
  right: 20px;
}

details[open]>summary::after {
  position: absolute;
  content: "-";
  right: 20px;
}

details>summary::-webkit-details-marker {
  display: none;
}

textarea {
  width: 95%;
  height: 200px;
  padding: 8px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-bottom: 0.5rem;
}

.visiable {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.order {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.up {
  cursor: pointer;
}

.down {
  cursor: pointer;
}

.edu_table {
  table {
    border-collapse: collapse;
    width: 100%;
  }

  td {
    text-align: center;
    vertical-align: middle;
    padding: 8px;
    border-bottom: 1px solid #ddd;
    border-top: 1px solid #ddd;
  }
}

.action-container {
  display: flex;
  align-items: center;
}

.action-container span {
  margin: 0 5px;
}

.hr-space-square {
  border: 0;
  color: #d0d0d5;
  background: linear-gradient(currentColor, currentColor) no-repeat center;
  background-size: calc(100% - 1.5em - 6px) 1px;
  display: flex;
  justify-content: space-between;
}

.hr-space-square::before,
.hr-space-square::after {
  content: '';
  display: block;
  width: .75em; height: .75em;
  transform: rotate(45deg);
  box-sizing: border-box;
  border: 1px solid;
  margin: 3px;
}